Skip to content

feat(google-ads): add google ads integration for campaign and ad performance queries#3360

Merged
waleedlatif1 merged 8 commits intostagingfrom
waleedlatif1/google-ads
Mar 13, 2026
Merged

feat(google-ads): add google ads integration for campaign and ad performance queries#3360
waleedlatif1 merged 8 commits intostagingfrom
waleedlatif1/google-ads

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add Google Ads integration with 6 tools: list customers, list campaigns, campaign performance, list ad groups, ad performance, custom GAQL query
  • Register OAuth provider in auth.ts, oauth.ts, and oauth-required-modal with adwords scope
  • Add block with operation dropdown, developer token field, wandConfig on GAQL input, and optional fields behind advanced mode
  • Generate docs with manual intro section

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 13, 2026 1:50am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR adds a complete Google Ads integration with 6 tools (list customers, list campaigns, campaign performance, list ad groups, ad performance, and custom GAQL queries). The implementation follows established patterns with proper OAuth setup, input validation, and comprehensive block configuration including AI-assisted query generation via wandConfig.

Key additions:

  • OAuth provider registration with adwords scope across auth.ts, oauth.ts, and oauth-required-modal
  • Six tool implementations with validated GAQL query construction
  • Block configuration with operation dropdown, conditional fields, and advanced mode
  • Comprehensive documentation with manual intro section
  • Input validation functions for IDs, statuses, dates, and date ranges

The code follows project standards with absolute imports, proper type definitions, correct credential visibility settings (hidden for OAuth, user-only for developer token per custom rules), and consistent error handling patterns.

Confidence Score: 5/5

  • This PR is safe to merge with no critical issues found
  • The implementation is well-structured, follows all project patterns and custom instructions, includes proper validation and error handling, and demonstrates thorough attention to security with appropriate credential visibility settings
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/tools/google_ads/types.ts Defines TypeScript types and validation functions for Google Ads API parameters with proper input validation
apps/sim/tools/google_ads/campaign_performance.ts Implements campaign performance tool with validated GAQL query generation and date range handling
apps/sim/tools/google_ads/ad_performance.ts Implements ad performance tool with filtering by campaign/ad group and proper validation
apps/sim/tools/google_ads/search.ts Implements custom GAQL query tool with pagination support and proper search settings
apps/sim/blocks/blocks/google_ads.ts Defines block configuration with operation dropdown, conditional fields, and wandConfig for AI-assisted GAQL query generation
apps/sim/lib/auth/auth.ts Adds google-ads OAuth provider with proper scopes, redirect URI, and user info fetching
apps/sim/lib/oauth/oauth.ts Registers google-ads service in OAuth provider configuration with icon and scopes
apps/sim/tools/registry.ts Registers all six Google Ads tools in the global tools registry

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Start[User selects operation] --> OAuth[Connect Google Ads account]
    OAuth --> Config[Configure parameters]
    Config --> Route{Route by operation}
    Route -->|list_customers| LC[List Customers Tool]
    Route -->|list_campaigns| LCamp[List Campaigns Tool]
    Route -->|campaign_performance| CP[Campaign Performance Tool]
    Route -->|list_ad_groups| LAG[List Ad Groups Tool]
    Route -->|ad_performance| AP[Ad Performance Tool]
    Route -->|search| GS[Custom GAQL Query Tool]
    LC --> Validate[Validate inputs]
    LCamp --> Validate
    CP --> Validate
    LAG --> Validate
    AP --> Validate
    GS --> Validate
    Validate --> BuildQuery[Build GAQL query]
    BuildQuery --> CallAPI[Call Google Ads API]
    CallAPI --> Transform[Transform response]
    Transform --> Output[Return formatted output]
Loading

Last reviewed commit: 129de50

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

20 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@greptile

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

waleedlatif1 and others added 6 commits March 12, 2026 18:35
- Replace hardcoded scopes in auth.ts with getCanonicalScopesForProvider('google-ads')
- Replace hardcoded requiredScopes in block with getScopesForService('google-ads')
- Add type re-export from index.ts barrel

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/google-ads branch from 6703226 to 88cfe0c Compare March 13, 2026 01:43
Align google-ads with all other Google services by including
userinfo.email and userinfo.profile scopes in the centralized
OAUTH_PROVIDERS config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1 waleedlatif1 merged commit a8bbab2 into staging Mar 13, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/google-ads branch March 13, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant